import random
import time
# 将Java的byte数组转化为字符串
# toString([-26, -83, -90, -26, -78, -101, -23, -67, -112])
def toString(byte_list):

    bs = bytearray()  # python字节数组
    for item in byte_list:
        if item < 0:
            item = item + 256
        bs.append(item)

    str_data = bs.decode('utf-8')  # data = bytes(bs)
    print(str_data)
    return str_data

# 创建安卓id
def create_android_id(size=9):
    data_list = []
    for i in range(1, size):
        part = "".join(random.sample("0123456789ABCDEF", 2))
        data_list.append(part)
    return "".join(data_list).lower()

__author__ = 'Joynice'
from faker import Faker
user_agent = Faker('zh-CN').user_agent()
def get_header():
    return {
        'User-Agent': user_agent,



        'Priority': 'u=1, i',
        'Referer': 'https://www.douyin.com/?recommend=1',
        'Sec-Ch-Ua': '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
        'Sec-Ch-Ua-Mobile': '?0',
        'Sec-Ch-Ua-Platform': '"Windows"',
        'Sec-Fetch-Dest':'empty',
        'Sec-Fetch-Mode': 'cors',
        'Sec-Fetch-Site': 'same-origin',
    }

def get_time():
    return int(time.time())